Add Python SDK documentation for async and agent-to-agent features#114
Add Python SDK documentation for async and agent-to-agent features#114
Conversation
Co-Authored-By: jhaynie@agentuity.com <jhaynie@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
| agentuity new | ||
| ``` | ||
|
|
||
| ## Creating Your First Agent |
There was a problem hiding this comment.
remove this section since agentuity new creates this file.
| Add the following code to your agent file: | ||
|
|
||
| ```python | ||
| def run(request, response, context): |
| Start the local development server: | ||
|
|
||
| ```bash | ||
| uv run test.py |
There was a problem hiding this comment.
agentuity dev should be the command to run development server
| Test your agent by sending a request: | ||
|
|
||
| ```bash | ||
| curl -v http://localhost:3500/agent_HaDpiH67c4851eISzbAWfZqwLtnpguW6 --json '{"hello":"world"}' |
There was a problem hiding this comment.
tell them to go to the app link in the output and use the UI
| ## Installation | ||
|
|
||
| ```bash | ||
| pip install agentuity |
There was a problem hiding this comment.
refer to the proper installation instructions
Co-Authored-By: jhaynie@agentuity.com <jhaynie@gmail.com>
| ```python | ||
| async def run(request, response, context): | ||
| # Call another agent by ID | ||
| result = await response.handoff({"id": "other_agent_id"}) |
There was a problem hiding this comment.
| result = await response.handoff({"id": "other_agent_id"}) | |
| return await response.handoff({"id": "other_agent_id"}) |
| return result | ||
|
|
||
| # Or call by name | ||
| # result = await response.handoff({"name": "OtherAgentName"}) |
There was a problem hiding this comment.
| # result = await response.handoff({"name": "OtherAgentName"}) | |
| # return response.handoff({"name": "OtherAgentName"}) |
|
|
||
| # Or call by name | ||
| # result = await response.handoff({"name": "OtherAgentName"}) | ||
| # return result |
There was a problem hiding this comment.
| # return result |
Co-Authored-By: jhaynie@agentuity.com <jhaynie@gmail.com>
Co-Authored-By: jhaynie@agentuity.com <jhaynie@gmail.com>
| return response.binary(b"\x00\x01\x02\x03", "application/octet-stream") | ||
|
|
||
| # Empty response with metadata | ||
| return response.empty({"status": "processed"}) |
There was a problem hiding this comment.
remove empty since that doesn't exist
| return response.text("Hello, world!") | ||
|
|
||
| # HTML response | ||
| return response.html("<h1>Hello, world!</h1>") |
There was a problem hiding this comment.
remove html since it doesn't exit
| @@ -0,0 +1,62 @@ | |||
| --- | |||
There was a problem hiding this comment.
we have most of this information in index.mdx
Co-Authored-By: jhaynie@agentuity.com <jhaynie@gmail.com>
Co-Authored-By: jhaynie@agentuity.com <jhaynie@gmail.com>
| @@ -0,0 +1,3 @@ | |||
| { | |||
| @@ -0,0 +1,20 @@ | |||
| --- | |||
There was a problem hiding this comment.
remove this doc and references to it
Co-Authored-By: jhaynie@agentuity.com <jhaynie@gmail.com>
Co-Authored-By: jhaynie@agentuity.com <jhaynie@gmail.com>
| <p>Work with various data types and streaming capabilities</p> | ||
| </Card> | ||
|
|
||
| <Card href="/docs/SDKs/python/crewai"> |
Co-Authored-By: jhaynie@agentuity.com <jhaynie@gmail.com>
|
please re-write the PR description to reflect all the changes |
| ```python | ||
| async def run(request, response, context): | ||
| # Resolve an agent (local or remote) | ||
| agent = context.get_agent("remote_agent_id") |
There was a problem hiding this comment.
| agent = context.get_agent("remote_agent_id") | |
| agent = context.get_agent({"id": "remote_agent_id"}) |
|
|
||
| async def run(request, response, context): | ||
| # Resolve by ID | ||
| agent = resolve_agent(context, "agent_id") |
There was a problem hiding this comment.
use context.get_agent({"id": "agent_id"}) instead of resolve_agent which is meant to be internal
…parameters Co-Authored-By: jhaynie@agentuity.com <jhaynie@gmail.com>
Python SDK Documentation Update
This PR adds documentation for the Python SDK's async and agent-to-agent communication features introduced in PR #38 of the sdk-py repository.
Changes
Implementation Details
References
Verification
The documentation has been tested locally to ensure it renders correctly.